import request from '@/utils/request'

// 查询用例列表
export function listCase(query) {
  return request({
    url: '/ai_smart/case/list',
    method: 'get',
    params: query
  })
}

// 查询用例详细
export function getCase(id) {
  return request({
    url: '/ai_smart/case/' + id,
    method: 'get'
  })
}

// 新增用例
export function addCase(data) {
  return request({
    url: '/ai_smart/case',
    method: 'post',
    data: data
  })
}

// 修改用例
export function updateCase(data) {
  return request({
    url: '/ai_smart/case',
    method: 'put',
    data: data
  })
}

// 删除用例
export function delCase(id) {
  return request({
    url: '/ai_smart/case/' + id,
    method: 'delete'
  })
}

// 获取项目列表
export function getProjectList(){
  return request({
    url: '/ai_smart/case/projects',
    method: 'get'
  })
}

// 获取功能树根据项目编号
export function listFun(projectNo){
  return request({
    url: '/ai_smart/case/fun/' + projectNo,
    method: 'get'
  })
}

// getPointtList
export function getPointList(projectFunNo){
  return request({
    url: '/ai_smart/case/point/' + projectFunNo,
    method: 'get'
  })
}

// 查看用例历史记录
export function case_history(pointNo) {
  return request({
    url: '/ai_smart/case/history/' + pointNo,
    method: 'post'
  })
}

// 用例通过审核
export function case_checked_pass(caseNo) {
  return request({
    url: '/ai_smart/case/check/' + caseNo,
    method: 'post'
  })
}


// 用例通过审核
export function set_current_case(data) {
  return request({
    url: '/ai_smart/case/set_current_case',
    data: data,
    method: 'post'
  })
}